package cn.wolfcode.trip.base.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Getter@Setter
public class GoodsType extends BaseDomain {

    public static final Integer TYPE_OPEN = 1; //启用
    public static final Integer TYPE_CLOSE = 0; //禁用
    private String name;

    private Integer state = TYPE_OPEN;

    public Object getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("state", state);
        return JSON.toJSONString(map);
    }

    public String getStateName() {
        return this.state == TYPE_OPEN?"启用":"禁用";
    }


}